package com.rmi.hello;

import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 * Created by buguniao on 15/12/8.
 */
public class RemoteServer {
    public static void main(String[] args) throws AlreadyBoundException {
        try {
            Registry registry = LocateRegistry.createRegistry(5590);

            HelloRemoteImpl1 server = new HelloRemoteImpl1();
            Naming.rebind("//localhost:5590/HelloRemote", server);
           // registry.bind("xxxx",server);
            //System.out.println("server start ……");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
